Database consolidation involves distributing and sharing computing resources among multiple databases. Databases may be consolidated using a container database management system. A consolidated database, such as a multitenant container database (CDB), includes one or more pluggable databases (PDBs).
A container database includes a data dictionary, which comprises metadata that defines database objects in the container database. For example, the data dictionary for a given CDB will include metadata describing each PDB that is contained in the given CDB, including the database objects included in each PDB. Further, each pluggable database includes a PDB-specific database dictionary that comprises metadata that defines database objects contained in the pluggable database. Database objects include tables, table columns, indexes, files, tablespaces, data types, users, user privileges, and storage structures used for storing database object data, etc.
A container database may manage multiple pluggable databases and a given database server instance may manage and serve those pluggable databases from the container database. As such, a given container database allows multiple pluggable databases to run on the same database server and/or database server instance, allowing the computing resources of a single database server or instance to be shared between multiple pluggable databases. In a container database management system, each pluggable database may be opened or closed in the container database independently from other pluggable databases.
An application may access a pluggable database by establishing a database session on the container database management system for that pluggable database, where a database session represents the connection between an application and the container database management system for accessing the pluggable database. A database session is initiated for a pluggable database by, for example, transmitting a request for a new connection to the container database management system, the request specifying the pluggable database. In response to such a request, the container database management system establishes the requested database session. A container database management system may host multiple database sessions, each database session being for one of multiple pluggable databases.
A given container database is configured based on the requirements of those database management system (DBMS) features that are applicable to the container database. A DBMS feature that is applicable to a container database is one that interacts with or influences the container database and, as such, requires a certain configuration of the container database. DBMS features that may be applicable to a given container database, comprise one or more of: a version of the DBMS that manages the container database (including major version, minor version, and/or patch level); optional features that may be installed or implemented for a container database (such as data encryption, a feature that allows multiple levels of data restriction within areas of the database, localization enablement); common users that exist in the container database; independently-installed patches that have been installed for the DBMS that manages the container database; etc.
The configuration of a CDB encompasses aspects of the CDB that are adjusted based on the DBMS features that are applicable to the CDB. Such aspects of the CDB comprise one or more of: data stored within or the structure of the database objects stored in the pluggable databases of the CDB; the layout or content of the underlying operating system files of the CDB; the number of background processes required by the CDB; identifiers associated with the CDB; variables required for CDB functionality; initialization parameters; a character set with which data in the CDB is encoded; time zones supported by the CDB; standard database block size; tablespace settings; undo settings; services supported by the CDB; special features implemented for the CDB; database server instance cluster support for the CDB; etc.
Pluggable databases may be “plugged in” to a container database, and may be transported between database servers and/or database management systems. A database server instance plugs a pluggable database into a container database by including metadata describing the pluggable database in the database dictionary of the container database and by initiating management of the pluggable database as part of the container database. Any number of the aspects of the configuration of a container database, into which a particular pluggable database is plugged, affects the pluggable database.
When a pluggable database is moved to a destination container database from a source container database, where the destination and source container databases have the same configuration, the pluggable database need not be reconfigured prior to making the pluggable database available to operations at the destination container database. However, the source and destination container databases of a relocating pluggable database are not always configured for the same set of DBMS features. When a pluggable database is moved to a destination container database that has a different configuration than the source container database of the pluggable database, the relocated pluggable database is reconfigured to conform to the configuration of the destination container database, which allows the relocated pluggable database to be compatible with the DBMS features that are applicable to the destination container database.
Generally, in order to reconfigure a pluggable database in a particular container database, database administrators are required to run, from the DBMS kernel, update scripts over the container database. These update scripts update the configuration of the pluggable database within the container database to conform to the configuration of the container database. Many times, such update scripts require input from the administrator running the scripts, as well as access to session variables and other situation-specific information.
As such, administrator effort is required to prepare the configuration of a relocated pluggable database to ensure proper functioning of the pluggable database for the DBMS features that are applicable to the destination container database. Also, since the reconfiguration process is not automated, it is possible for administrators to inadvertently err during the reconfiguration process, which results in incorrectly configuring the relocated pluggable database. In such cases, administrators must restart the reconfiguration process to remedy resulting issues.
It would be beneficial to automate the process of reconfiguring a relocated pluggable database, and, by so doing, reduce the amount of administrator effort required to relocate a pluggable database from a source to a destination container database.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.